Skip to content

models: accept a local Fairchem checkpoint in batch mode - #39

Merged
niklashoelter merged 2 commits into
niklashoelter:masterfrom
avnoordenne:fix/fairchem-local-checkpoint-in-batch
Sep 25, 2026
Merged

niklashoelter merged 2 commits into
niklashoelter:masterfrom
avnoordenne:fix/fairchem-local-checkpoint-in-batch

Conversation

@avnoordenne

Copy link
Copy Markdown
Contributor

_load_fairchem_torchsim called _verify_model_name_and_cache_dir before
branching on model_path. That helper raises when model_name is empty, so a
config supplying only a local checkpoint failed in batch mode with

ValueError: Model name must be specified in the configuration

while the same config optimized fine in sequential mode, because
_load_fairchem_calculator checks model_path first. The name is now resolved
only on the branch that needs it, matching the ASE loader. model_name is
still required when no checkpoint is given.

Tests: 3 new in tests/models/test_fairchem.py. Full suite: 247 passed, 3 skipped.

Touches the same test file as #5; whichever merges second needs a trivial
rebase.

avnoordenne and others added 2 commits September 25, 2026 12:00
_load_fairchem_torchsim called _verify_model_name_and_cache_dir before
branching on model_path. That helper raises when model_name is empty, so a
config supplying only a local checkpoint was rejected:

    ValueError: Model name must be specified in the configuration

_load_fairchem_calculator checks model_path first and has no such problem, so
the same config optimized fine in sequential mode and failed in batch mode.
Resolve the name only on the branch that needs it, matching the ASE loader.

model_name is still required when no checkpoint is given -- deferring that to
FairChemModel would report it from somewhere much less obvious.
# Conflicts:
#	tests/models/test_fairchem.py
@niklashoelter
niklashoelter merged commit 9eab9f9 into niklashoelter:master Sep 25, 2026
1 check passed
@avnoordenne
avnoordenne deleted the fix/fairchem-local-checkpoint-in-batch branch October 1, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants